<template>
<div>
</div>
</template>
<script>
import { getI9RIA } from 'src/service/getData'
import {cookie} from 'config/utils'
import {mapMutations} from 'vuex'
export default {
  data () {
    return {
    }
  },
  mounted () {
    if (cookie('unionid')) {
      this.$router.push('/index')
    }
    this.initData()
  },
  methods: {
    ...mapMutations([
      'RECORD_I9RIA' // 登陆成功后保存用户信息
    ]),
    async initData () {
      let tmpData = await getI9RIA()
      if (tmpData.code === 9999) {
        this.$router.push('/nofound')
      } else {
        this.RECORD_I9RIA(tmpData)
        this.$router.push('/index')
      }
    }
  }
}
</script>
<style>
</style>
